

TESTLIB_OBJECTS=testutils.o
TEST_LIB=libtestlib.a


OBJECTS=ObjectSAXParser.o

LIBS=-lxml2 -L. -lobjectsaxparser
CXX=g++
DEBUG_FLAG=-g
CFLAGS=-Wall
INCLUDES=-I/usr/include/libxml2
AR=ar

OBJSAXER_LIB=libobjectsaxparser.a

saxer: saxer.o $(OBJSAXER_LIB)
	$(CXX) $(DEBUG_FLAG) -o $@ $(LIBS) saxer.o $(OBJECTS)

testStrings: testStrings.o $(TEST_LIB)
	$(CXX) $(DEBUG_FLAG) -o $@ testStrings.o -L. -ltestlib

%.o: %.cc
	$(CXX) -c $(DEBUG_FLAG) -o $@ $(CFLAGS) $(INCLUDES) $<

$(OBJSAXER_LIB): $(OBJECTS)
	$(AR) cruv $@ $(OBJECTS)

$(TEST_LIB): $(TESTLIB_OBJECTS)
	$(AR) cruv $@ $(TESTLIB_OBJECTS)



.PHONY: clean

clean:
	rm -f saxer *.o *.a

# todo, add dependency generation
$(OBJECTS): ObjectSAXParser.hh 